package com.hsxc.cdz.monitor.bean.pile.v1_33;

import com.hsxc.cdz.base.util.BytesUtil;
/**
 * 
 * @author 陈钊
 *
 */
public class StateChangePileMsg extends PileMessage {
	
	public static final int length = 2;
	private int  parameter;         //变化参数:1 充电状态,2 故障状态，3预约状态，4充电插头状态
	private int value;              //参数值    1 true，2 false
	public static final int CHARGE_STATE = 1;
	public static final int FAULT_STATE = 2;
	public static final int RESERVE_STATE = 3;
	public static final int PLUG_STATE = 4;
	public static final int STATE_TRUE = 1;
	public static final int STATE_FALSE =2;
	
	public int getParameter() {
		return parameter;
	}
	public void setParameter(int parameter) {
		this.parameter = parameter;
	}
	public int getValue() {
		return value;
	}
	public void setValue(int value) {
		this.value = value;
	}

	@Override
	public void getContentFromByte(byte[] data) {
		byte[] temp;
        temp = BytesUtil.getByte(0,1,data);
        this.setParameter(BytesUtil.bytesToIntSeq(temp));
        
        temp = BytesUtil.getByte(1, 1, data);
        this.setValue(BytesUtil.bytesToIntSeq(temp));
	}

}
